﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Concurrent;
using InternetSpiderLib;

namespace WeChatGZHTextExtractor
{
    public class UrlMonitoringQueue
    {
        private static UrlMonitoringQueue _UrlMonitoringQueue = new UrlMonitoringQueue();

        private ConcurrentQueue<DataBox> Stack = new ConcurrentQueue<DataBox>();

        public static UrlMonitoringQueue GetInstance()
        {
            return _UrlMonitoringQueue;
        }

        public void AddDataBox(DataBox data)
        {
            Stack.Enqueue(data);
        }

        public bool TryPop(out DataBox data)
        {
            return Stack.TryDequeue(out data);
        }

        public bool TryPeek(out DataBox data)
        {
            return Stack.TryPeek(out data);
        }
    }
}
